<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>批发商列表</title>
    <!--bootstrap-select  css文件-->
    <link rel="stylesheet" type="text/css" href="js/bootstrapselect/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="js/bootstrapselect/css/bootstrap-select.css"/>
    <!--日期  css文件-->
    <link rel="stylesheet" type="text/css" href="js/datepicker/css/bootstrap-datepicker.css">
    <!--弹窗 css文件-->
    <link rel="stylesheet" type="text/css" href="js/layer/layer.css">
    <!--图片点击放大  css文件-->
    <link rel="stylesheet" href="js/viewer/css/viewer.min.css">
    <!--主要css样式-->
    <link rel="stylesheet" type="text/css" href="css/models.css">
</head>
<body>
<div class="MainContent">
    <!--主体内容-->
    <div class="MainCont">
        <div class="ph_snbBtn">
            <button class="columnBtn" name="" value="刷新">刷新</button>
            <button class="columnBtn" name="" value="导出">导出</button>
        </div>
        <!--筛选条件-->
        <div class="ph_screen">
            <table class="ph_tableBox">
                <tr>
                    <th>行业分类：</th>
                    <td>
                        <select class="selectpicker" data-live-search="true">
                            <option value="">全部</option>
                            <option value="">一级分类名称</option>
                            <option value="">一级分类名称</option>
                            <option value="">一级分类名称</option>
                            <option value="">一级分类名称</option>
                            <option value="">一级分类名称</option>

                        </select>
                    </td>
                    <th>审核状态：</th>
                    <td>
                        <select class="selectpicker">
                            <option value="">全部</option>
                            <option value="">待审核</option>
                            <option value="">已通过</option>
                            <option value="">未通过</option>
                        </select>
                    </td>
                    <th>账号状态：</th>
                    <td>
                        <select class="selectpicker">
                            <option value="">全部</option>
                            <option value="">待审核</option>
                            <option value="">已通过</option>
                            <option value="">未通过</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>特惠批发商：</th>
                    <td>
                        <select class="selectpicker">
                            <option value="">全部</option>
                            <option value="">待审核</option>
                            <option value="">已通过</option>
                            <option value="">未通过</option>
                        </select>
                    </td>
                    <th>批发商账号：</th>
                    <td><input type="text" name=""/></td>
                    <th>企业名称：</th>
                    <td><input type="text" name=""/></td>
                </tr>
                <tr>
                    <th>所属代理：</th>
                    <td><input type="text" name=""/></td>
                    <td colspan="4">
                        <input name="" type="button" value="搜索"><input name="" type="button" value="重置">
                    </td>
                </tr>
            </table>
        </div>
        <!--end 筛选条件-->
        <!--商品列表-->
        <div class="ph_wareBox ph_tabScroll">
            <table class="ph_wareList" id="example"></table>
        </div>
        <!--end 商品列表-->
    </div>
    <!--end 主体内容-->
</div>
<!--不通过审核原因弹窗-->
<div class="PopupBox" id="ph_returnBox">
    <!--内容-->
    <div class="ph_subPoCon">
        <form id="formID">
            <ul class="addList">
                <li>
                    <label for=""><span class="require">*</span>审核：</label>
                    <span class="radioBtn"><input class="examineEadio" name="radio" type="radio" value="1">通过审核</span>
                    <span class="radioBtn"><input class="examineEadio" name="radio" type="radio" value="0" checked="checked">不通过审核</span>
                </li>
                <li class="explainTxt"><label for=""><span class="require">*</span>不通过说明：</label><textarea class="validate[required] ph_txtAreaBg" name="" id="" cols="30" rows="10"></textarea></li>
            </ul>
        </form>
    </div>
    <!--end 内容-->
</div>
<!--end 不通过审核原因弹窗-->
<!--推荐顺序弹窗-->
<div class="PopupBox" id="ph_RecommendBox">
    <!--内容-->
    <div class="ph_subPoCon">
        <form id="formID2">
            <ul class="addList">
                <li>
                    <label for="">置顶顺序：</label>
                    <input type="text">
                </li>
            </ul>
        </form>
    </div>
    <!--end 内容-->
</div>
<!--end 推荐顺序弹窗-->
<!--转让弹窗-->
<div class="PopupBox" id="ph_TransferBox">
    <!--内容-->
    <div class="ph_subPoCon">
        <form id="formID3">
            <ul class="addList">
                <li>
                    <label for="">转让至手机号：</label>
                    <input type="text">
                </li>
            </ul>
        </form>
    </div>
    <!--end 内容-->
</div>
<!--end 转让弹窗-->
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<!--bootstrap-select-->
<script type="text/javascript" src="js/bootstrapselect/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrapselect/bootstrap-select.js"></script>
<script type="text/javascript" src="js/bootstrapselect/select.js"></script>
<!--日期控件-->
<script type="text/javascript" src="js/datepicker/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="js/datepicker/jquery.timepicker.js"></script>
<script type="text/javascript" src="js/datepicker/jquery.datepair.js"></script>
<script type="text/javascript" src="js/datepicker/datepicker.js"></script>
<!--验证-->
<script type="text/javascript" src="js/validat/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="js/validat/jquery.validationEngine.js"></script>
<!--分页-->
<script type="text/javascript" src="js/pages/jquery.dataTables.min.js"></script>
<!--弹窗-->
<script type="text/javascript" src="js/layer/layer.js"></script>
<script type="text/javascript">
    $(function () {
        //table点击和双击点击事件
        $('#example').on('dblclick', 'tbody tr', function () {
            var index = layer.open({
                type: 2,
                title: '批发商详情',
                closeBtn: 1,
                //area: ['442px','280px'],
                //maxmin: true,
                shade: 0,
                btn: ['返回'],
                btnAlign: 'c',
                content: 'jxf_wholesaledetails.html'
            });
            layer.full(index);
        });
        //验证
        $("#formID").validationEngine({
            addPromptClass: 'formError-text',
            showArrow: false,
            promptPosition: 'bottomLeft:10 0'
        });
        //不通过审核原因
        $('.ph_wareList').on('click','.js_Examine',function(){
            layer.open({
                type: 1,
                title: '审核批发商',
                closeBtn : 1,
                area: ['460px','auto'],
                //maxmin: true,
                btn:['保存','取消'],
                btnAlign: 'c',
                content: $('#ph_returnBox')
            });
        });
        //置顶顺序
        $('.ph_wareList').on('click','.Js_Recommend',function(){
            var wholesaleName=$(this).parents('tr').find('td').eq(1).text(); //批发商企业名称
            layer.open({
                type: 1,
                title: '设置【'+wholesaleName+'】置顶顺序',
                closeBtn : 1,
                area: ['460px','auto'],
                //maxmin: true,
                btn:['保存','取消'],
                btnAlign: 'c',
                content: $('#ph_RecommendBox')
            });
        });
        //转让
        $('.ph_wareList').on('click','.Js_Transfer',function(){
            var wholesaleName=$(this).parents('tr').find('td').eq(1).text(); //批发商企业名称
            layer.open({
                type: 1,
                title: '转让【'+wholesaleName+'】至新的主体',
                closeBtn : 1,
                area: ['460px','auto'],
                //maxmin: true,
                btn:['保存','取消'],
                btnAlign: 'c',
                content: $('#ph_TransferBox')
            });
        });
        $('.addList').on('click','.examineEadio',function(){
            var thiVal = $(this).val();
            if(parseInt(thiVal)){
                $('.explainTxt').hide();
            }else{
                $('.explainTxt').show();
            }
        });
        $('#example').DataTable({
            "bServerSide": true,
            "sPaginationType": "full_numbers",
            //"bJQueryUI": true,
            "sDom": '<"">t<"F"ip>',
            "autoWidth": false,  //自适应宽度
            //"sAjaxSource": "${ctx}/api/user/list", //ajax调用接口
            //<div class="btn-group" style="text-align:left;"><button type="button" class="btn btn-info dropdown-toggle"data-toggle="dropdown">操作 <span class="caret"></span></button>
            "sAjaxSource": "data/arrays.txt", //ajax调用接口
            "aoColumnDefs": [{sDefaultContent: '', orderable: false, aTargets: ['_all']}],
            "aoColumns": [
//                {
//                    "sWidth": "30px",
//                    "sTitle": "<input class= \"check-all\" name=\"\" type=\"checkbox\">",
//                    "mData": "id",
//                    "mRender": function () {
//                        return '<input class="ids" name="" type="checkbox">';
//                    }
//                },
                {"sWidth": "50px", "sTitle": "编号", "mData": "id"},
                {"sTitle": "企业名称", "mData": "id1"},
                {"sTitle": "批发商帐号", "mData": "id2"},
                {"sTitle": "所属代理", "mData": "id2"},
                {"sTitle": "行业分类", "mData": "id2"},
                {"sWidth": "110px","sTitle": "特惠批发商", "mData": "id2", "mRender": function () {
                    return '<span>是</span>'; //默认颜色就不用加样式名
                    //return '<span class="gray">否</span>';  //gray 灰色
                }
                },
                {"sTitle": "注册时间", "mData": "id2"},
                {"sTitle": "置顶顺序", "mData": "id2"},
                {"sTitle": "注册时间", "mData": "id2"},
                {
                    "sTitle": "审核状态", "mData": "id5", "mRender": function () {
                        return '<span>已通过</span>'; //默认颜色就不用加样式名
                        //return '<span class="gray">已冻结</span>';  //gray 灰色
                    }
                },
                {
                    "sTitle": "账号状态", "mData": "id5", "mRender": function () {
                    return '<span>正常</span>'; //默认颜色就不用加样式名
                    //return '<span class="gray">已冻结</span>';  //gray 灰色
                }
                },
                {
                    "sWidth": "110px",
                    "sTitle": "操作",
                    "mData": "id",
                    "sClass": "ph_tableShow",
                    "mRender": function (data, type, full) {
                        var text = '<div class="operateBox"><input class="operate" name="" type="button" value="操作选项">';
                        text += '<ul class="operateList hide" role="menu">';
                        text += '<li><a class="js_Frozen" href="javascript:void(0);">冻结</a></li>';
                        text += '<li><a class="Js_Enable" href="javascript:void(0);">解冻</a></li>';
                        text += '<li><a class="Js_Enable" href="javascript:void(0);">重置密码</a></li>';
                        text += '<li><a href="javascript:void(0);">设为/取消特惠</a></li>';
                        text += '<li><a class="Js_Recommend" href="javascript:void(0);">置顶顺序</a></li>';
                        text += '<li><a class="Js_Transfer" href="javascript:void(0);">转让</a></li>';
                        text += '<li><a class="js_Examine" href="javascript:void(0);">审核</a></li>';
                        text += '</ul></div>';
                        return text;
                    }
                }
            ],
            "oLanguage": {
                "sProcessing": "数据加载中······",
                "sLengthMenu": "显示 _MENU_ 条记录",
                "sZeroRecords": "没有您要搜索的内容！",
                "sEmptyTable": "列表中无数据存在！",
                "sInfo": "当前显示 _START_ 到 _END_ 条数据，共 _TOTAL_ 条数据",
                "sInfoEmpty": "显示 0 到 0 条记录",
                "sInfoFiltered": "数据列表中共  _MAX_ 条记录",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上一页",
                    "sNext": "下一页",
                    "sLast": "末页"
                }
            }
            /*"fnServerData" : function ( sSource, aoData, fnCallback, oSettings ) {
               oSettings.jqXHR = $.ajax( {
                   "dataType" 	: 'json',
                   "type" 		: "GET",
                   "async"     : 'false',
                   "url" 		: sSource,
                   "data" 		: {
                       'pageNum': (aoData[3].value/aoData[4].value)+1,
                       'pageSize' :  aoData[4].value,
                       'telphone'  :  $("#telphone").val(),
                       'isable' : $('#isable').val()
                   },
                   "success"	: fnCallback
               } );
           }*/
        });
    });
</script>
</body>
</html>